package com.ruoyi.retirement.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.retirement.mapper.RetirementClassifyTwoMapper;
import com.ruoyi.retirement.domain.RetirementClassifyTwo;
import com.ruoyi.retirement.service.IRetirementClassifyTwoService;

/**
 * 文章二级分类Service业务层处理
 * 
 * @author 曹旭
 * @date 2025-09-01
 */
@Service
public class RetirementClassifyTwoServiceImpl implements IRetirementClassifyTwoService 
{
    @Autowired
    private RetirementClassifyTwoMapper retirementClassifyTwoMapper;

    /**
     * 查询文章二级分类
     * 
     * @param id 文章二级分类主键
     * @return 文章二级分类
     */
    @Override
    public RetirementClassifyTwo selectRetirementClassifyTwoById(Long id)
    {
        return retirementClassifyTwoMapper.selectRetirementClassifyTwoById(id);
    }

    /**
     * 查询文章二级分类列表
     * 
     * @param retirementClassifyTwo 文章二级分类
     * @return 文章二级分类
     */
    @Override
    public List<RetirementClassifyTwo> selectRetirementClassifyTwoList(RetirementClassifyTwo retirementClassifyTwo)
    {
        return retirementClassifyTwoMapper.selectRetirementClassifyTwoList(retirementClassifyTwo);
    }

    /**
     * 新增文章二级分类
     * 
     * @param retirementClassifyTwo 文章二级分类
     * @return 结果
     */
    @Override
    public int insertRetirementClassifyTwo(RetirementClassifyTwo retirementClassifyTwo)
    {
        retirementClassifyTwo.setCreateTime(DateUtils.getNowDate());
        return retirementClassifyTwoMapper.insertRetirementClassifyTwo(retirementClassifyTwo);
    }

    /**
     * 修改文章二级分类
     * 
     * @param retirementClassifyTwo 文章二级分类
     * @return 结果
     */
    @Override
    public int updateRetirementClassifyTwo(RetirementClassifyTwo retirementClassifyTwo)
    {
        retirementClassifyTwo.setUpdateTime(DateUtils.getNowDate());
        return retirementClassifyTwoMapper.updateRetirementClassifyTwo(retirementClassifyTwo);
    }

    /**
     * 批量删除文章二级分类
     * 
     * @param ids 需要删除的文章二级分类主键
     * @return 结果
     */
    @Override
    public int deleteRetirementClassifyTwoByIds(Long[] ids)
    {
        return retirementClassifyTwoMapper.deleteRetirementClassifyTwoByIds(ids);
    }

    /**
     * 删除文章二级分类信息
     * 
     * @param id 文章二级分类主键
     * @return 结果
     */
    @Override
    public int deleteRetirementClassifyTwoById(Long id)
    {
        return retirementClassifyTwoMapper.deleteRetirementClassifyTwoById(id);
    }
}
